package com.easybuilder.common.base.entity;

import com.easybuilder.common.annotation.SqlCondition;
import com.easybuilder.common.enums.RelationType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ZXS
 * @version 1.0
 * @description 查询条件类
 * @date 2021-5-26 22:56
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class SearchEntity {
    //表名
    private String tableName;
    //当前页码
    private int pageNum = 0;
    //分页大小
    private int pageSize = 10;
    //查询条件
    private List<Criteria> criterias;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @ToString
    public static class Criteria {
        //属性名称
        private String fieldName;
        //关系1
        private RelationType relationType;
        //值1
        private Object value;
        //关系2
        private RelationType relationType2;
        //值2
        private Object value2;
    }

}
